package com.pagepub.core.tag.validate;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * 验证框架工厂
 * @author ggd
 *
 */
public class PortalValidatorUtilFactory
{
	private static Log log = LogFactory.getLog(PortalValidatorUtilFactory.class);
	private PortalValidatorUtilFactory(){};
	/**
	 * 取得MyValidatorUtil实例，默认１.3版本的

	 * @return
	 */
	public static PortalValidatorUtil getInstance()
	{
		try
		{
			return new PortalValidatorUtil13Impl();
		}
		catch (Exception e)
		{
			log.error("MyValidatorUtilFactory.getInstance()出错!",e);
			return null;
		}
	}
	/**
	 * 取得MyValidatorUtil实例，根据实现类来产生

	 * @param implClazz
	 * @return
	 */
	public static PortalValidatorUtil getInstance(Class implClazz)
	{
		try
		{
			return (PortalValidatorUtil)implClazz.newInstance();
		}
		catch (Exception e)
		{
			log.error("MyValidatorUtilFactory.getInstance("+implClazz.getName()+")出错!",e);
			return null;
		}
	}	
}
